home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / Runnable.java < prev    next >
Text File  |  1998-09-22  |  2KB  |  57 lines

  1. /*
  2.  * @(#)Runnable.java    1.14 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.lang;
  16.  
  17. /**
  18.  * The <code>Runnable</code> interface should be implemented by any 
  19.  * class whose instances are intended to be executed by a thread. The 
  20.  * class must define a method of no arguments called <code>run</code>.
  21.  * <p>
  22.  * This interface is designed to provide a common protocol for objects that
  23.  * wish to execute code while they are active. For example,
  24.  * <code>Runnable</code> is implemented by class <code>Thread</code>.
  25.  * Being active simply means that a thread has been started and has not
  26.  * yet been stopped. 
  27.  * <p>
  28.  * In addition, <code>Runnable</code> provides the means for a class to be
  29.  * active while not subclassing <code>Thread</code>. A class that implements
  30.  * <code>Runnable</code> can run without subclassing <code>Thread</code>
  31.  * by instantiating a <code>Thread</code> instance and passing itself in
  32.  * as the target.  In most cases, the <code>Runnable</code> interface should
  33.  * be used if you are only planning to override the <code>run()</code>
  34.  * method and no other <code>Thread</code> methods.  
  35.  * This is important because classes should not be subclassed
  36.  * unless the programmer intends on modifying or enhancing the fundamental
  37.  * behavior of the class.
  38.  *
  39.  * @author  Arthur van Hoff
  40.  * @version 1.14, 07/01/98
  41.  * @see     java.lang.Thread
  42.  * @since   JDK1.0 * @see     Thread
  43.  */
  44. public
  45. interface Runnable {
  46.     /**
  47.      * When an object implementing interface <code>Runnable</code> is used 
  48.      * to create a thread, starting the thread causes the object's 
  49.      * <code>run</code> method to be called in that separately executing 
  50.      * thread. 
  51.      *
  52.      * @see     java.lang.Thread#run()
  53.      * @since   JDK1.0
  54.      */
  55.     public abstract void run();
  56. }
  57.